<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="wz_jsgraphics.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>wz_jsgraphics.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'wz_jsgraphics.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="jsgFont.html">jsgFont</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="jsgStroke.html">jsgStroke</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

	<a name="method_summary"><!-- --></a>
	<table border="1" cellpadding="3" cellspacing="0" width="100%">
		<tr bgcolor="#CCCCFF" class="TableHeadingColor">
			<td colspan=2>
				<font size="+2">
					<b>Method Summary</b>
				</font>
			</td>
		</tr>
	
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_chkDHTM">_chkDHTM</a></b>(wnd, x, i)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_CompInt">_CompInt</a></b>(x, y)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_htmPrtRpc">_htmPrtRpc</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;Object</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_htmRpc">_htmRpc</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkDiv">_mkDiv</a></b>(x, y, w, h)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkDivIe">_mkDivIe</a></b>(x, y, w, h)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkDivPrt">_mkDivPrt</a></b>(x, y, w, h)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkLin">_mkLin</a></b>(x1, y1, x2, y2)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkLin2D">_mkLin2D</a></b>(x1, y1, x2, y2)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkLinDott">_mkLinDott</a></b>(x1, y1, x2, y2)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkLinVirt">_mkLinVirt</a></b>(aLin, x1, y1, x2, y2)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkOv">_mkOv</a></b>(left, top, width, height)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkOv2D">_mkOv2D</a></b>(left, top, width, height)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkOvDott">_mkOvDott</a></b>(left, top, width, height)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkRect">_mkRect</a></b>(x, y, w, h)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_mkRectDott">_mkRectDott</a></b>(x, y, w, h)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_pntCnvDom">_pntCnvDom</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_pntCnvIe">_pntCnvIe</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_pntDoc">_pntDoc</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!_pntN">_pntN</a></b>()
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
	
	</table>
    <p>

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/* This notice must be untouched at all times.

wz_jsgraphics.js    v. 3.05
The latest version is available at
http://www.walterzorn.com
or http://www.devira.com
or http://www.walterzorn.de

Copyright (c) 2002-2009 Walter Zorn. All rights reserved.
Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
Last modified: 2. 2. 2009

Performance optimizations for Internet Explorer
by Thomas Frank and John Holdsworth.
fillPolygon method implemented by Matthieu Haller.

High Performance JavaScript Graphics Library.
Provides methods
- to draw lines, rectangles, ellipses, polygons
	with specifiable line thickness,
- to fill rectangles, polygons, ellipses and arcs
- to draw text.
NOTE: Operations, functions and branching have rather been optimized
to efficiency and speed than to shortness of source code.

LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
or see http://www.gnu.org/copyleft/lesser.html
*/</span>


var jg_ok, jg_ie, jg_fast, jg_dom, jg_moz;


<span class="reserved">function</span> _chkDHTM(wnd, x, i)
<span class="comment">// Under XUL, owner of 'document' must be specified explicitly</span>
{
	x = wnd.document.body || null;
	jg_ie = x &amp;&amp; typeof x.insertAdjacentHTML != <span class="literal">"undefined"</span> &amp;&amp; wnd.document.createElement;
	jg_dom = (x &amp;&amp; !jg_ie &amp;&amp;
		typeof x.appendChild != <span class="literal">"undefined"</span> &amp;&amp;
		typeof wnd.document.createRange != <span class="literal">"undefined"</span> &amp;&amp;
		typeof (i = wnd.document.createRange()).setStartBefore != <span class="literal">"undefined"</span> &amp;&amp;
		typeof i.createContextualFragment != <span class="literal">"undefined"</span>);
	jg_fast = jg_ie &amp;&amp; wnd.document.all &amp;&amp; !wnd.opera;
	jg_moz = jg_dom &amp;&amp; typeof x.style.MozOpacity != <span class="literal">"undefined"</span>;
	jg_ok = !!(jg_ie || jg_dom);
};

<span class="reserved">function</span> _pntCnvDom()
{
	var x = <span class="reserved">this</span>.wnd.document.createRange();
	x.setStartBefore(<span class="reserved">this</span>.cnv);
	x = x.createContextualFragment(jg_fast? <span class="reserved">this</span>._htmRpc() : <span class="reserved">this</span>.htm);
	<span class="reserved">if</span>(<span class="reserved">this</span>.cnv) <span class="reserved">this</span>.cnv.appendChild(x);
	<span class="reserved">this</span>.htm = <span class="literal">""</span>;
};

<span class="reserved">function</span> _pntCnvIe()
{
	<span class="reserved">if</span>(<span class="reserved">this</span>.cnv) <span class="reserved">this</span>.cnv.insertAdjacentHTML(<span class="literal">"BeforeEnd"</span>, jg_fast? <span class="reserved">this</span>._htmRpc() : <span class="reserved">this</span>.htm);
	<span class="reserved">this</span>.htm = <span class="literal">""</span>;
};

<span class="reserved">function</span> _pntDoc()
{
	<span class="reserved">this</span>.wnd.document.write(jg_fast? <span class="reserved">this</span>._htmRpc() : <span class="reserved">this</span>.htm);
	<span class="reserved">this</span>.htm = <span class="literal">''</span>;
};

<span class="reserved">function</span> _pntN()
{
	;
};

<span class="reserved">function</span> _mkDiv(x, y, w, h)
{
	<span class="reserved">this</span>.htm += <span class="literal">'&lt;div style="position:absolute;'</span>+
		<span class="literal">'left:'</span> + x + <span class="literal">'px;'</span>+
		<span class="literal">'top:'</span> + y + <span class="literal">'px;'</span>+
		<span class="literal">'width:'</span> + w + <span class="literal">'px;'</span>+
		<span class="literal">'height:'</span> + h + <span class="literal">'px;'</span>+
		<span class="literal">'clip:rect(0,'</span>+w+<span class="literal">'px,'</span>+h+<span class="literal">'px,0);'</span>+
		<span class="literal">'background-color:'</span> + <span class="reserved">this</span>.color +
		(!jg_moz? <span class="literal">';overflow:hidden'</span> : <span class="literal">''</span>)+
		<span class="literal">';"&gt;&lt;\/div&gt;'</span>;
};

<span class="reserved">function</span> _mkDivIe(x, y, w, h)
{
	<span class="reserved">this</span>.htm += <span class="literal">'%%'</span>+<span class="reserved">this</span>.color+<span class="literal">';'</span>+x+<span class="literal">';'</span>+y+<span class="literal">';'</span>+w+<span class="literal">';'</span>+h+<span class="literal">';'</span>;
};

<span class="reserved">function</span> _mkDivPrt(x, y, w, h)
{
	<span class="reserved">this</span>.htm += <span class="literal">'&lt;div style="position:absolute;'</span>+
		<span class="literal">'border-left:'</span> + w + <span class="literal">'px solid '</span> + <span class="reserved">this</span>.color + <span class="literal">';'</span>+
		<span class="literal">'left:'</span> + x + <span class="literal">'px;'</span>+
		<span class="literal">'top:'</span> + y + <span class="literal">'px;'</span>+
		<span class="literal">'width:0px;'</span>+
		<span class="literal">'height:'</span> + h + <span class="literal">'px;'</span>+
		<span class="literal">'clip:rect(0,'</span>+w+<span class="literal">'px,'</span>+h+<span class="literal">'px,0);'</span>+
		<span class="literal">'background-color:'</span> + <span class="reserved">this</span>.color +
		(!jg_moz? <span class="literal">';overflow:hidden'</span> : <span class="literal">''</span>)+
		<span class="literal">';"&gt;&lt;\/div&gt;'</span>;
};

var _regex =  /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g;
<span class="reserved">function</span> _htmRpc()
{
	<span class="reserved">return</span> <span class="reserved">this</span>.htm.replace(
		_regex,
		<span class="literal">'&lt;div style="overflow:hidden;position:absolute;background-color:'</span>+
		<span class="literal">'$1;left:$2px;top:$3px;width:$4px;height:$5px"&gt;&lt;/div&gt;\n'</span>);
};

<span class="reserved">function</span> _htmPrtRpc()
{
	<span class="reserved">return</span> <span class="reserved">this</span>.htm.replace(
		_regex,
		<span class="literal">'&lt;div style="overflow:hidden;position:absolute;background-color:'</span>+
		<span class="literal">'$1;left:$2px;top:$3px;width:$4px;height:$5px;border-left:$4px solid $1"&gt;&lt;/div&gt;\n'</span>);
};

<span class="reserved">function</span> _mkLin(x1, y1, x2, y2)
{
	<span class="reserved">if</span>(x1 &gt; x2)
	{
		var _x2 = x2;
		var _y2 = y2;
		x2 = x1;
		y2 = y1;
		x1 = _x2;
		y1 = _y2;
	}
	var dx = x2-x1, dy = Math.abs(y2-y1),
	x = x1, y = y1,
	yIncr = (y1 &gt; y2)? -1 : 1;

	<span class="reserved">if</span>(dx &gt;= dy)
	{
		var pr = dy&lt;&lt;1,
		pru = pr - (dx&lt;&lt;1),
		p = pr-dx,
		ox = x;
		<span class="reserved">while</span>(dx &gt; 0)
		{--dx;
			++x;
			<span class="reserved">if</span>(p &gt; 0)
			{
				<span class="reserved">this</span>._mkDiv(ox, y, x-ox, 1);
				y += yIncr;
				p += pru;
				ox = x;
			}
			<span class="reserved">else</span> p += pr;
		}
		<span class="reserved">this</span>._mkDiv(ox, y, x2-ox+1, 1);
	}

	<span class="reserved">else</span>
	{
		var pr = dx&lt;&lt;1,
		pru = pr - (dy&lt;&lt;1),
		p = pr-dy,
		oy = y;
		<span class="reserved">if</span>(y2 &lt;= y1)
		{
			<span class="reserved">while</span>(dy &gt; 0)
			{--dy;
				<span class="reserved">if</span>(p &gt; 0)
				{
					<span class="reserved">this</span>._mkDiv(x++, y, 1, oy-y+1);
					y += yIncr;
					p += pru;
					oy = y;
				}
				<span class="reserved">else</span>
				{
					y += yIncr;
					p += pr;
				}
			}
			<span class="reserved">this</span>._mkDiv(x2, y2, 1, oy-y2+1);
		}
		<span class="reserved">else</span>
		{
			<span class="reserved">while</span>(dy &gt; 0)
			{--dy;
				y += yIncr;
				<span class="reserved">if</span>(p &gt; 0)
				{
					<span class="reserved">this</span>._mkDiv(x++, oy, 1, y-oy);
					p += pru;
					oy = y;
				}
				<span class="reserved">else</span> p += pr;
			}
			<span class="reserved">this</span>._mkDiv(x2, oy, 1, y2-oy+1);
		}
	}
};

<span class="reserved">function</span> _mkLin2D(x1, y1, x2, y2)
{
	<span class="reserved">if</span>(x1 &gt; x2)
	{
		var _x2 = x2;
		var _y2 = y2;
		x2 = x1;
		y2 = y1;
		x1 = _x2;
		y1 = _y2;
	}
	var dx = x2-x1, dy = Math.abs(y2-y1),
	x = x1, y = y1,
	yIncr = (y1 &gt; y2)? -1 : 1;

	var s = <span class="reserved">this</span>.stroke;
	<span class="reserved">if</span>(dx &gt;= dy)
	{
		<span class="reserved">if</span>(dx &gt; 0 &amp;&amp; s-3 &gt; 0)
		{
			var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s&gt;&gt;1)*dy) / dx;
			_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
		}
		<span class="reserved">else</span> var _s = s;
		var ad = Math.ceil(s/2);

		var pr = dy&lt;&lt;1,
		pru = pr - (dx&lt;&lt;1),
		p = pr-dx,
		ox = x;
		<span class="reserved">while</span>(dx &gt; 0)
		{--dx;
			++x;
			<span class="reserved">if</span>(p &gt; 0)
			{
				<span class="reserved">this</span>._mkDiv(ox, y, x-ox+ad, _s);
				y += yIncr;
				p += pru;
				ox = x;
			}
			<span class="reserved">else</span> p += pr;
		}
		<span class="reserved">this</span>._mkDiv(ox, y, x2-ox+ad+1, _s);
	}

	<span class="reserved">else</span>
	{
		<span class="reserved">if</span>(s-3 &gt; 0)
		{
			var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s&gt;&gt;1)*dx-dy) / dy;
			_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
		}
		<span class="reserved">else</span> var _s = s;
		var ad = Math.round(s/2);

		var pr = dx&lt;&lt;1,
		pru = pr - (dy&lt;&lt;1),
		p = pr-dy,
		oy = y;
		<span class="reserved">if</span>(y2 &lt;= y1)
		{
			++ad;
			<span class="reserved">while</span>(dy &gt; 0)
			{--dy;
				<span class="reserved">if</span>(p &gt; 0)
				{
					<span class="reserved">this</span>._mkDiv(x++, y, _s, oy-y+ad);
					y += yIncr;
					p += pru;
					oy = y;
				}
				<span class="reserved">else</span>
				{
					y += yIncr;
					p += pr;
				}
			}
			<span class="reserved">this</span>._mkDiv(x2, y2, _s, oy-y2+ad);
		}
		<span class="reserved">else</span>
		{
			<span class="reserved">while</span>(dy &gt; 0)
			{--dy;
				y += yIncr;
				<span class="reserved">if</span>(p &gt; 0)
				{
					<span class="reserved">this</span>._mkDiv(x++, oy, _s, y-oy+ad);
					p += pru;
					oy = y;
				}
				<span class="reserved">else</span> p += pr;
			}
			<span class="reserved">this</span>._mkDiv(x2, oy, _s, y2-oy+ad+1);
		}
	}
};

<span class="reserved">function</span> _mkLinDott(x1, y1, x2, y2)
{
	<span class="reserved">if</span>(x1 &gt; x2)
	{
		var _x2 = x2;
		var _y2 = y2;
		x2 = x1;
		y2 = y1;
		x1 = _x2;
		y1 = _y2;
	}
	var dx = x2-x1, dy = Math.abs(y2-y1),
	x = x1, y = y1,
	yIncr = (y1 &gt; y2)? -1 : 1,
	drw = true;
	<span class="reserved">if</span>(dx &gt;= dy)
	{
		var pr = dy&lt;&lt;1,
		pru = pr - (dx&lt;&lt;1),
		p = pr-dx;
		<span class="reserved">while</span>(dx &gt; 0)
		{--dx;
			<span class="reserved">if</span>(drw) <span class="reserved">this</span>._mkDiv(x, y, 1, 1);
			drw = !drw;
			<span class="reserved">if</span>(p &gt; 0)
			{
				y += yIncr;
				p += pru;
			}
			<span class="reserved">else</span> p += pr;
			++x;
		}
	}
	<span class="reserved">else</span>
	{
		var pr = dx&lt;&lt;1,
		pru = pr - (dy&lt;&lt;1),
		p = pr-dy;
		<span class="reserved">while</span>(dy &gt; 0)
		{--dy;
			<span class="reserved">if</span>(drw) <span class="reserved">this</span>._mkDiv(x, y, 1, 1);
			drw = !drw;
			y += yIncr;
			<span class="reserved">if</span>(p &gt; 0)
			{
				++x;
				p += pru;
			}
			<span class="reserved">else</span> p += pr;
		}
	}
	<span class="reserved">if</span>(drw) <span class="reserved">this</span>._mkDiv(x, y, 1, 1);
};

<span class="reserved">function</span> _mkOv(left, top, width, height)
{
	var a = (++width)&gt;&gt;1, b = (++height)&gt;&gt;1,
	wod = width&amp;1, hod = height&amp;1,
	cx = left+a, cy = top+b,
	x = 0, y = b,
	ox = 0, oy = b,
	aa2 = (a*a)&lt;&lt;1, aa4 = aa2&lt;&lt;1, bb2 = (b*b)&lt;&lt;1, bb4 = bb2&lt;&lt;1,
	st = (aa2&gt;&gt;1)*(1-(b&lt;&lt;1)) + bb2,
	tt = (bb2&gt;&gt;1) - aa2*((b&lt;&lt;1)-1),
	w, h;
	<span class="reserved">while</span>(y &gt; 0)
	{
		<span class="reserved">if</span>(st &lt; 0)
		{
			st += bb2*((x&lt;&lt;1)+3);
			tt += bb4*(++x);
		}
		<span class="reserved">else</span> <span class="reserved">if</span>(tt &lt; 0)
		{
			st += bb2*((x&lt;&lt;1)+3) - aa4*(y-1);
			tt += bb4*(++x) - aa2*(((y--)&lt;&lt;1)-3);
			w = x-ox;
			h = oy-y;
			<span class="reserved">if</span>((w&amp;2) &amp;&amp; (h&amp;2))
			{
				<span class="reserved">this</span>._mkOvQds(cx, cy, x-2, y+2, 1, 1, wod, hod);
				<span class="reserved">this</span>._mkOvQds(cx, cy, x-1, y+1, 1, 1, wod, hod);
			}
			<span class="reserved">else</span> <span class="reserved">this</span>._mkOvQds(cx, cy, x-1, oy, w, h, wod, hod);
			ox = x;
			oy = y;
		}
		<span class="reserved">else</span>
		{
			tt -= aa2*((y&lt;&lt;1)-3);
			st -= aa4*(--y);
		}
	}
	w = a-ox+1;
	h = (oy&lt;&lt;1)+hod;
	y = cy-oy;
	<span class="reserved">this</span>._mkDiv(cx-a, y, w, h);
	<span class="reserved">this</span>._mkDiv(cx+ox+wod-1, y, w, h);
};

<span class="reserved">function</span> _mkOv2D(left, top, width, height)
{
	var s = <span class="reserved">this</span>.stroke;
	width += s+1;
	height += s+1;
	var a = width&gt;&gt;1, b = height&gt;&gt;1,
	wod = width&amp;1, hod = height&amp;1,
	cx = left+a, cy = top+b,
	x = 0, y = b,
	aa2 = (a*a)&lt;&lt;1, aa4 = aa2&lt;&lt;1, bb2 = (b*b)&lt;&lt;1, bb4 = bb2&lt;&lt;1,
	st = (aa2&gt;&gt;1)*(1-(b&lt;&lt;1)) + bb2,
	tt = (bb2&gt;&gt;1) - aa2*((b&lt;&lt;1)-1);

	<span class="reserved">if</span>(s-4 &lt; 0 &amp;&amp; (!(s-2) || width-51 &gt; 0 &amp;&amp; height-51 &gt; 0))
	{
		var ox = 0, oy = b,
		w, h,
		pxw;
		<span class="reserved">while</span>(y &gt; 0)
		{
			<span class="reserved">if</span>(st &lt; 0)
			{
				st += bb2*((x&lt;&lt;1)+3);
				tt += bb4*(++x);
			}
			<span class="reserved">else</span> <span class="reserved">if</span>(tt &lt; 0)
			{
				st += bb2*((x&lt;&lt;1)+3) - aa4*(y-1);
				tt += bb4*(++x) - aa2*(((y--)&lt;&lt;1)-3);
				w = x-ox;
				h = oy-y;

				<span class="reserved">if</span>(w-1)
				{
					pxw = w+1+(s&amp;1);
					h = s;
				}
				<span class="reserved">else</span> <span class="reserved">if</span>(h-1)
				{
					pxw = s;
					h += 1+(s&amp;1);
				}
				<span class="reserved">else</span> pxw = h = s;
				<span class="reserved">this</span>._mkOvQds(cx, cy, x-1, oy, pxw, h, wod, hod);
				ox = x;
				oy = y;
			}
			<span class="reserved">else</span>
			{
				tt -= aa2*((y&lt;&lt;1)-3);
				st -= aa4*(--y);
			}
		}
		<span class="reserved">this</span>._mkDiv(cx-a, cy-oy, s, (oy&lt;&lt;1)+hod);
		<span class="reserved">this</span>._mkDiv(cx+a+wod-s, cy-oy, s, (oy&lt;&lt;1)+hod);
	}

	<span class="reserved">else</span>
	{
		var _a = (width-(s&lt;&lt;1))&gt;&gt;1,
		_b = (height-(s&lt;&lt;1))&gt;&gt;1,
		_x = 0, _y = _b,
		_aa2 = (_a*_a)&lt;&lt;1, _aa4 = _aa2&lt;&lt;1, _bb2 = (_b*_b)&lt;&lt;1, _bb4 = _bb2&lt;&lt;1,
		_st = (_aa2&gt;&gt;1)*(1-(_b&lt;&lt;1)) + _bb2,
		_tt = (_bb2&gt;&gt;1) - _aa2*((_b&lt;&lt;1)-1),

		pxl = new Array(),
		pxt = new Array(),
		_pxb = [];
		pxl[0] = 0;
		pxt[0] = b;
		_pxb[0] = _b-1;
		<span class="reserved">while</span>(y &gt; 0)
		{
			<span class="reserved">if</span>(st &lt; 0)
			{
				pxl[pxl.length] = x;
				pxt[pxt.length] = y;
				st += bb2*((x&lt;&lt;1)+3);
				tt += bb4*(++x);
			}
			<span class="reserved">else</span> <span class="reserved">if</span>(tt &lt; 0)
			{
				pxl[pxl.length] = x;
				st += bb2*((x&lt;&lt;1)+3) - aa4*(y-1);
				tt += bb4*(++x) - aa2*(((y--)&lt;&lt;1)-3);
				pxt[pxt.length] = y;
			}
			<span class="reserved">else</span>
			{
				tt -= aa2*((y&lt;&lt;1)-3);
				st -= aa4*(--y);
			}

			<span class="reserved">if</span>(_y &gt; 0)
			{
				<span class="reserved">if</span>(_st &lt; 0)
				{
					_st += _bb2*((_x&lt;&lt;1)+3);
					_tt += _bb4*(++_x);
					_pxb[_pxb.length] = _y-1;
				}
				<span class="reserved">else</span> <span class="reserved">if</span>(_tt &lt; 0)
				{
					_st += _bb2*((_x&lt;&lt;1)+3) - _aa4*(_y-1);
					_tt += _bb4*(++_x) - _aa2*(((_y--)&lt;&lt;1)-3);
					_pxb[_pxb.length] = _y-1;
				}
				<span class="reserved">else</span>
				{
					_tt -= _aa2*((_y&lt;&lt;1)-3);
					_st -= _aa4*(--_y);
					_pxb[_pxb.length-1]--;
				}
			}
		}

		var ox = -wod, oy = b,
		_oy = _pxb[0],
		l = pxl.length,
		w, h;
		<span class="reserved">for</span>(var i = 0; i &lt; l; i++)
		{
			<span class="reserved">if</span>(typeof _pxb[i] != <span class="literal">"undefined"</span>)
			{
				<span class="reserved">if</span>(_pxb[i] &lt; _oy || pxt[i] &lt; oy)
				{
					x = pxl[i];
					<span class="reserved">this</span>._mkOvQds(cx, cy, x, oy, x-ox, oy-_oy, wod, hod);
					ox = x;
					oy = pxt[i];
					_oy = _pxb[i];
				}
			}
			<span class="reserved">else</span>
			{
				x = pxl[i];
				<span class="reserved">this</span>._mkDiv(cx-x, cy-oy, 1, (oy&lt;&lt;1)+hod);
				<span class="reserved">this</span>._mkDiv(cx+ox+wod, cy-oy, 1, (oy&lt;&lt;1)+hod);
				ox = x;
				oy = pxt[i];
			}
		}
		<span class="reserved">this</span>._mkDiv(cx-a, cy-oy, 1, (oy&lt;&lt;1)+hod);
		<span class="reserved">this</span>._mkDiv(cx+ox+wod, cy-oy, 1, (oy&lt;&lt;1)+hod);
	}
};

<span class="reserved">function</span> _mkOvDott(left, top, width, height)
{
	var a = (++width)&gt;&gt;1, b = (++height)&gt;&gt;1,
	wod = width&amp;1, hod = height&amp;1, hodu = hod^1,
	cx = left+a, cy = top+b,
	x = 0, y = b,
	aa2 = (a*a)&lt;&lt;1, aa4 = aa2&lt;&lt;1, bb2 = (b*b)&lt;&lt;1, bb4 = bb2&lt;&lt;1,
	st = (aa2&gt;&gt;1)*(1-(b&lt;&lt;1)) + bb2,
	tt = (bb2&gt;&gt;1) - aa2*((b&lt;&lt;1)-1),
	drw = true;
	<span class="reserved">while</span>(y &gt; 0)
	{
		<span class="reserved">if</span>(st &lt; 0)
		{
			st += bb2*((x&lt;&lt;1)+3);
			tt += bb4*(++x);
		}
		<span class="reserved">else</span> <span class="reserved">if</span>(tt &lt; 0)
		{
			st += bb2*((x&lt;&lt;1)+3) - aa4*(y-1);
			tt += bb4*(++x) - aa2*(((y--)&lt;&lt;1)-3);
		}
		<span class="reserved">else</span>
		{
			tt -= aa2*((y&lt;&lt;1)-3);
			st -= aa4*(--y);
		}
		<span class="reserved">if</span>(drw &amp;&amp; y &gt;= hodu) <span class="reserved">this</span>._mkOvQds(cx, cy, x, y, 1, 1, wod, hod);
		drw = !drw;
	}
};

<span class="reserved">function</span> _mkRect(x, y, w, h)
{
	var s = <span class="reserved">this</span>.stroke;
	<span class="reserved">this</span>._mkDiv(x, y, w, s);
	<span class="reserved">this</span>._mkDiv(x+w, y, s, h);
	<span class="reserved">this</span>._mkDiv(x, y+h, w+s, s);
	<span class="reserved">this</span>._mkDiv(x, y+s, s, h-s);
};

<span class="reserved">function</span> _mkRectDott(x, y, w, h)
{
	<span class="reserved">this</span>.drawLine(x, y, x+w, y);
	<span class="reserved">this</span>.drawLine(x+w, y, x+w, y+h);
	<span class="reserved">this</span>.drawLine(x, y+h, x+w, y+h);
	<span class="reserved">this</span>.drawLine(x, y, x, y+h);
};

<span class="reserved">function</span> jsgFont()
{
	<span class="reserved">this</span>.PLAIN = <span class="literal">'font-weight:normal;'</span>;
	<span class="reserved">this</span>.BOLD = <span class="literal">'font-weight:bold;'</span>;
	<span class="reserved">this</span>.ITALIC = <span class="literal">'font-style:italic;'</span>;
	<span class="reserved">this</span>.ITALIC_BOLD = <span class="reserved">this</span>.ITALIC + <span class="reserved">this</span>.BOLD;
	<span class="reserved">this</span>.BOLD_ITALIC = <span class="reserved">this</span>.ITALIC_BOLD;
};
var Font = new jsgFont();

<span class="reserved">function</span> jsgStroke()
{
	<span class="reserved">this</span>.DOTTED = -1;
};
var Stroke = new jsgStroke();

<span class="reserved">function</span> jsGraphics(cnv, wnd)
{
	<span class="reserved">this</span>.setColor = <span class="reserved">function</span>(x)
	{
		<span class="reserved">this</span>.color = x.toLowerCase();
	};

	<span class="reserved">this</span>.setStroke = <span class="reserved">function</span>(x)
	{
		<span class="reserved">this</span>.stroke = x;
		<span class="reserved">if</span>(!(x+1))
		{
			<span class="reserved">this</span>.drawLine = _mkLinDott;
			<span class="reserved">this</span>._mkOv = _mkOvDott;
			<span class="reserved">this</span>.drawRect = _mkRectDott;
		}
		<span class="reserved">else</span> <span class="reserved">if</span>(x-1 &gt; 0)
		{
			<span class="reserved">this</span>.drawLine = _mkLin2D;
			<span class="reserved">this</span>._mkOv = _mkOv2D;
			<span class="reserved">this</span>.drawRect = _mkRect;
		}
		<span class="reserved">else</span>
		{
			<span class="reserved">this</span>.drawLine = _mkLin;
			<span class="reserved">this</span>._mkOv = _mkOv;
			<span class="reserved">this</span>.drawRect = _mkRect;
		}
	};

	<span class="reserved">this</span>.setPrintable = <span class="reserved">function</span>(arg)
	{
		<span class="reserved">this</span>.printable = arg;
		<span class="reserved">if</span>(jg_fast)
		{
			<span class="reserved">this</span>._mkDiv = _mkDivIe;
			<span class="reserved">this</span>._htmRpc = arg? _htmPrtRpc : _htmRpc;
		}
		<span class="reserved">else</span> <span class="reserved">this</span>._mkDiv = arg? _mkDivPrt : _mkDiv;
	};

	<span class="reserved">this</span>.setFont = <span class="reserved">function</span>(fam, sz, sty)
	{
		<span class="reserved">this</span>.ftFam = fam;
		<span class="reserved">this</span>.ftSz = sz;
		<span class="reserved">this</span>.ftSty = sty || Font.PLAIN;
	};

	<span class="reserved">this</span>.drawPolyline = <span class="reserved">this</span>.drawPolyLine = <span class="reserved">function</span>(x, y)
	{
		<span class="reserved">for</span> (var i=x.length - 1; i;)
		{--i;
			<span class="reserved">this</span>.drawLine(x[i], y[i], x[i+1], y[i+1]);
		}
	};

	<span class="reserved">this</span>.fillRect = <span class="reserved">function</span>(x, y, w, h)
	{
		<span class="reserved">this</span>._mkDiv(x, y, w, h);
	};

	<span class="reserved">this</span>.drawPolygon = <span class="reserved">function</span>(x, y)
	{
		<span class="reserved">this</span>.drawPolyline(x, y);
		<span class="reserved">this</span>.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
	};

	<span class="reserved">this</span>.drawEllipse = <span class="reserved">this</span>.drawOval = <span class="reserved">function</span>(x, y, w, h)
	{
		<span class="reserved">this</span>._mkOv(x, y, w, h);
	};

	<span class="reserved">this</span>.fillEllipse = <span class="reserved">this</span>.fillOval = <span class="reserved">function</span>(left, top, w, h)
	{
		var a = w&gt;&gt;1, b = h&gt;&gt;1,
		wod = w&amp;1, hod = h&amp;1,
		cx = left+a, cy = top+b,
		x = 0, y = b, oy = b,
		aa2 = (a*a)&lt;&lt;1, aa4 = aa2&lt;&lt;1, bb2 = (b*b)&lt;&lt;1, bb4 = bb2&lt;&lt;1,
		st = (aa2&gt;&gt;1)*(1-(b&lt;&lt;1)) + bb2,
		tt = (bb2&gt;&gt;1) - aa2*((b&lt;&lt;1)-1),
		xl, dw, dh;
		<span class="reserved">if</span>(w) <span class="reserved">while</span>(y &gt; 0)
		{
			<span class="reserved">if</span>(st &lt; 0)
			{
				st += bb2*((x&lt;&lt;1)+3);
				tt += bb4*(++x);
			}
			<span class="reserved">else</span> <span class="reserved">if</span>(tt &lt; 0)
			{
				st += bb2*((x&lt;&lt;1)+3) - aa4*(y-1);
				xl = cx-x;
				dw = (x&lt;&lt;1)+wod;
				tt += bb4*(++x) - aa2*(((y--)&lt;&lt;1)-3);
				dh = oy-y;
				<span class="reserved">this</span>._mkDiv(xl, cy-oy, dw, dh);
				<span class="reserved">this</span>._mkDiv(xl, cy+y+hod, dw, dh);
				oy = y;
			}
			<span class="reserved">else</span>
			{
				tt -= aa2*((y&lt;&lt;1)-3);
				st -= aa4*(--y);
			}
		}
		<span class="reserved">this</span>._mkDiv(cx-a, cy-oy, w, (oy&lt;&lt;1)+hod);
	};

	<span class="reserved">this</span>.fillArc = <span class="reserved">function</span>(iL, iT, iW, iH, fAngA, fAngZ)
	{
		var a = iW&gt;&gt;1, b = iH&gt;&gt;1,
		iOdds = (iW&amp;1) | ((iH&amp;1) &lt;&lt; 16),
		cx = iL+a, cy = iT+b,
		x = 0, y = b, ox = x, oy = y,
		aa2 = (a*a)&lt;&lt;1, aa4 = aa2&lt;&lt;1, bb2 = (b*b)&lt;&lt;1, bb4 = bb2&lt;&lt;1,
		st = (aa2&gt;&gt;1)*(1-(b&lt;&lt;1)) + bb2,
		tt = (bb2&gt;&gt;1) - aa2*((b&lt;&lt;1)-1),
		<span class="comment">// Vars for radial boundary lines</span>
		xEndA, yEndA, xEndZ, yEndZ,
		iSects = (1 &lt;&lt; (Math.floor((fAngA %= 360.0)/180.0) &lt;&lt; 3))
				| (2 &lt;&lt; (Math.floor((fAngZ %= 360.0)/180.0) &lt;&lt; 3))
				| ((fAngA &gt;= fAngZ) &lt;&lt; 16),
		aBndA = new Array(b+1), aBndZ = new Array(b+1);
		
		<span class="comment">// Set up radial boundary lines</span>
		fAngA *= Math.PI/180.0;
		fAngZ *= Math.PI/180.0;
		xEndA = cx+Math.round(a*Math.cos(fAngA));
		yEndA = cy+Math.round(-b*Math.sin(fAngA));
		_mkLinVirt(aBndA, cx, cy, xEndA, yEndA);
		xEndZ = cx+Math.round(a*Math.cos(fAngZ));
		yEndZ = cy+Math.round(-b*Math.sin(fAngZ));
		_mkLinVirt(aBndZ, cx, cy, xEndZ, yEndZ);

		<span class="reserved">while</span>(y &gt; 0)
		{
			<span class="reserved">if</span>(st &lt; 0) <span class="comment">// Advance x</span>
			{
				st += bb2*((x&lt;&lt;1)+3);
				tt += bb4*(++x);
			}
			<span class="reserved">else</span> <span class="reserved">if</span>(tt &lt; 0) <span class="comment">// Advance x and y</span>
			{
				st += bb2*((x&lt;&lt;1)+3) - aa4*(y-1);
				ox = x;
				tt += bb4*(++x) - aa2*(((y--)&lt;&lt;1)-3);
				<span class="reserved">this</span>._mkArcDiv(ox, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects);
				oy = y;
			}
			<span class="reserved">else</span> <span class="comment">// Advance y</span>
			{
				tt -= aa2*((y&lt;&lt;1)-3);
				st -= aa4*(--y);
				<span class="reserved">if</span>(y &amp;&amp; (aBndA[y] != aBndA[y-1] || aBndZ[y] != aBndZ[y-1]))
				{
					<span class="reserved">this</span>._mkArcDiv(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects);
					ox = x;
					oy = y;
				}
			}
		}
		<span class="reserved">this</span>._mkArcDiv(x, 0, oy, cx, cy, iOdds, aBndA, aBndZ, iSects);
		<span class="reserved">if</span>(iOdds &gt;&gt; 16) <span class="comment">// Odd height</span>
		{
			<span class="reserved">if</span>(iSects &gt;&gt; 16) <span class="comment">// Start-angle &gt; end-angle</span>
			{
				var xl = (yEndA &lt;= cy || yEndZ &gt; cy)? (cx - x) : cx;
				<span class="reserved">this</span>._mkDiv(xl, cy, x + cx - xl + (iOdds &amp; 0xffff), 1);
			}
			<span class="reserved">else</span> <span class="reserved">if</span>((iSects &amp; 0x01) &amp;&amp; yEndZ &gt; cy)
				<span class="reserved">this</span>._mkDiv(cx - x, cy, x, 1);
		}
	};

<span class="comment">/* fillPolygon method, implemented by Matthieu Haller.
This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib.
C source of GD 1.8.4 found at http://www.boutell.com/gd/

THANKS to Kirsten Schulz for the polygon fixes!

The intersection finding technique of this code could be improved
by remembering the previous intertersection, and by using the slope.
That could help to adjust intersections to produce a nice
interior_extrema. */</span>
	<span class="reserved">this</span>.fillPolygon = <span class="reserved">function</span>(array_x, array_y)
	{
		var i;
		var y;
		var miny, maxy;
		var x1, y1;
		var x2, y2;
		var ind1, ind2;
		var ints;

		var n = array_x.length;
		<span class="reserved">if</span>(!n) <span class="reserved">return</span>;

		miny = array_y[0];
		maxy = array_y[0];
		<span class="reserved">for</span>(i = 1; i &lt; n; i++)
		{
			<span class="reserved">if</span>(array_y[i] &lt; miny)
				miny = array_y[i];

			<span class="reserved">if</span>(array_y[i] &gt; maxy)
				maxy = array_y[i];
		}
		<span class="reserved">for</span>(y = miny; y &lt;= maxy; y++)
		{
			var polyInts = [];
			ints = 0;
			<span class="reserved">for</span>(i = 0; i &lt; n; i++)
			{
				<span class="reserved">if</span>(!i)
				{
					ind1 = n-1;
					ind2 = 0;
				}
				<span class="reserved">else</span>
				{
					ind1 = i-1;
					ind2 = i;
				}
				y1 = array_y[ind1];
				y2 = array_y[ind2];
				<span class="reserved">if</span>(y1 &lt; y2)
				{
					x1 = array_x[ind1];
					x2 = array_x[ind2];
				}
				<span class="reserved">else</span> <span class="reserved">if</span>(y1 &gt; y2)
				{
					y2 = array_y[ind1];
					y1 = array_y[ind2];
					x2 = array_x[ind1];
					x1 = array_x[ind2];
				}
				<span class="reserved">else</span> continue;

				 <span class="comment">//  Modified 11. 2. 2004 Walter Zorn</span>
				<span class="reserved">if</span>((y &gt;= y1) &amp;&amp; (y &lt; y2))
					polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);

				<span class="reserved">else</span> <span class="reserved">if</span>((y == maxy) &amp;&amp; (y &gt; y1) &amp;&amp; (y &lt;= y2))
					polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
			}
			polyInts.sort(_CompInt);
			<span class="reserved">for</span>(i = 0; i &lt; ints; i+=2)
				<span class="reserved">this</span>._mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1);
		}
	};

	<span class="reserved">this</span>.drawString = <span class="reserved">function</span>(txt, x, y)
	{
		<span class="reserved">this</span>.htm += <span class="literal">'&lt;div style="position:absolute;white-space:nowrap;'</span>+
			<span class="literal">'left:'</span> + x + <span class="literal">'px;'</span>+
			<span class="literal">'top:'</span> + y + <span class="literal">'px;'</span>+
			<span class="literal">'font-family:'</span> +  <span class="reserved">this</span>.ftFam + <span class="literal">';'</span>+
			<span class="literal">'font-size:'</span> + <span class="reserved">this</span>.ftSz + <span class="literal">';'</span>+
			<span class="literal">'color:'</span> + <span class="reserved">this</span>.color + <span class="literal">';'</span> + <span class="reserved">this</span>.ftSty + <span class="literal">'"&gt;'</span>+
			txt +
			<span class="literal">'&lt;\/div&gt;'</span>;
	};

<span class="comment">/* drawStringRect() added by Rick Blommers.
Allows to specify the size of the text rectangle and to align the
text both horizontally (e.g. right) and vertically within that rectangle */</span>
	<span class="reserved">this</span>.drawStringRect = <span class="reserved">function</span>(txt, x, y, width, halign)
	{
		<span class="reserved">this</span>.htm += <span class="literal">'&lt;div style="position:absolute;overflow:hidden;'</span>+
			<span class="literal">'left:'</span> + x + <span class="literal">'px;'</span>+
			<span class="literal">'top:'</span> + y + <span class="literal">'px;'</span>+
			<span class="literal">'width:'</span>+width +<span class="literal">'px;'</span>+
			<span class="literal">'text-align:'</span>+halign+<span class="literal">';'</span>+
			<span class="literal">'font-family:'</span> +  <span class="reserved">this</span>.ftFam + <span class="literal">';'</span>+
			<span class="literal">'font-size:'</span> + <span class="reserved">this</span>.ftSz + <span class="literal">';'</span>+
			<span class="literal">'color:'</span> + <span class="reserved">this</span>.color + <span class="literal">';'</span> + <span class="reserved">this</span>.ftSty + <span class="literal">'"&gt;'</span>+
			txt +
			<span class="literal">'&lt;\/div&gt;'</span>;
	};

	<span class="reserved">this</span>.drawImage = <span class="reserved">function</span>(imgSrc, x, y, w, h, a)
	{
		<span class="reserved">this</span>.htm += <span class="literal">'&lt;div style="position:absolute;'</span>+
			<span class="literal">'left:'</span> + x + <span class="literal">'px;'</span>+
			<span class="literal">'top:'</span> + y + <span class="literal">'px;'</span>+
			<span class="comment">// w (width) and h (height) arguments are now optional.</span>
			<span class="comment">// Added by Mahmut Keygubatli, 14.1.2008</span>
			(w? (<span class="literal">'width:'</span> +  w + <span class="literal">'px;'</span>) : <span class="literal">''</span>) +
			(h? (<span class="literal">'height:'</span> + h + <span class="literal">'px;'</span>):<span class="literal">''</span>)+<span class="literal">'"&gt;'</span>+
			<span class="literal">'&lt;img src="'</span> + imgSrc +<span class="literal">'"'</span>+ (w ? (<span class="literal">' width="'</span> + w + <span class="literal">'"'</span>):<span class="literal">''</span>)+ (h ? (<span class="literal">' height="'</span> + h + <span class="literal">'"'</span>):<span class="literal">''</span>) + (a? (<span class="literal">' '</span>+a) : <span class="literal">''</span>) + <span class="literal">'&gt;'</span>+
			<span class="literal">'&lt;\/div&gt;'</span>;
	};

	<span class="reserved">this</span>.clear = <span class="reserved">function</span>()
	{
		<span class="reserved">this</span>.htm = <span class="literal">""</span>;
		<span class="reserved">if</span>(<span class="reserved">this</span>.cnv) <span class="reserved">this</span>.cnv.innerHTML = <span class="literal">""</span>;
	};

	<span class="reserved">this</span>._mkOvQds = <span class="reserved">function</span>(cx, cy, x, y, w, h, wod, hod)
	{
		var xl = cx - x, xr = cx + x + wod - w, yt = cy - y, yb = cy + y + hod - h;
		<span class="reserved">if</span>(xr &gt; xl+w)
		{
			<span class="reserved">this</span>._mkDiv(xr, yt, w, h);
			<span class="reserved">this</span>._mkDiv(xr, yb, w, h);
		}
		<span class="reserved">else</span>
			w = xr - xl + w;
		<span class="reserved">this</span>._mkDiv(xl, yt, w, h);
		<span class="reserved">this</span>._mkDiv(xl, yb, w, h);
	};
	
	<span class="reserved">this</span>._mkArcDiv = <span class="reserved">function</span>(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects)
	{
		var xrDef = cx + x + (iOdds &amp; 0xffff), y2, h = oy - y, xl, xr, w;

		<span class="reserved">if</span>(!h) h = 1;
		x = cx - x;

		<span class="reserved">if</span>(iSects &amp; 0xff0000) <span class="comment">// Start-angle &gt; end-angle</span>
		{
			y2 = cy - y - h;
			<span class="reserved">if</span>(iSects &amp; 0x00ff)
			{
				<span class="reserved">if</span>(iSects &amp; 0x02)
				{
					xl = Math.max(x, aBndZ[y]);
					w = xrDef - xl;
					<span class="reserved">if</span>(w &gt; 0) <span class="reserved">this</span>._mkDiv(xl, y2, w, h);
				}
				<span class="reserved">if</span>(iSects &amp; 0x01)
				{
					xr = Math.min(xrDef, aBndA[y]);
					w = xr - x;
					<span class="reserved">if</span>(w &gt; 0) <span class="reserved">this</span>._mkDiv(x, y2, w, h);
				}
			}
			<span class="reserved">else</span>
				<span class="reserved">this</span>._mkDiv(x, y2, xrDef - x, h);
			y2 = cy + y + (iOdds &gt;&gt; 16);
			<span class="reserved">if</span>(iSects &amp; 0xff00)
			{
				<span class="reserved">if</span>(iSects &amp; 0x0100)
				{
					xl = Math.max(x, aBndA[y]);
					w = xrDef - xl;
					<span class="reserved">if</span>(w &gt; 0) <span class="reserved">this</span>._mkDiv(xl, y2, w, h);
				}
				<span class="reserved">if</span>(iSects &amp; 0x0200)
				{
					xr = Math.min(xrDef, aBndZ[y]);
					w = xr - x;
					<span class="reserved">if</span>(w &gt; 0) <span class="reserved">this</span>._mkDiv(x, y2, w, h);
				}
			}
			<span class="reserved">else</span>
				<span class="reserved">this</span>._mkDiv(x, y2, xrDef - x, h);
		}
		<span class="reserved">else</span>
		{
			<span class="reserved">if</span>(iSects &amp; 0x00ff)
			{
				<span class="reserved">if</span>(iSects &amp; 0x02)
					xl = Math.max(x, aBndZ[y]);
				<span class="reserved">else</span>
					xl = x;
				<span class="reserved">if</span>(iSects &amp; 0x01)
					xr = Math.min(xrDef, aBndA[y]);
				<span class="reserved">else</span>
					xr = xrDef;
				y2 = cy - y - h;
				w = xr - xl;
				<span class="reserved">if</span>(w &gt; 0) <span class="reserved">this</span>._mkDiv(xl, y2, w, h);
			}
			<span class="reserved">if</span>(iSects &amp; 0xff00)
			{
				<span class="reserved">if</span>(iSects &amp; 0x0100)
					xl = Math.max(x, aBndA[y]);
				<span class="reserved">else</span>
					xl = x;
				<span class="reserved">if</span>(iSects &amp; 0x0200)
					xr = Math.min(xrDef, aBndZ[y]);
				<span class="reserved">else</span>
					xr = xrDef;
				y2 = cy + y + (iOdds &gt;&gt; 16);
				w = xr - xl;
				<span class="reserved">if</span>(w &gt; 0) <span class="reserved">this</span>._mkDiv(xl, y2, w, h);
			}
		}
	};

	<span class="reserved">this</span>.setStroke(1);
	<span class="reserved">this</span>.setFont(<span class="literal">"verdana,geneva,helvetica,sans-serif"</span>, <span class="literal">"12px"</span>, Font.PLAIN);
	<span class="reserved">this</span>.color = <span class="literal">"#000000"</span>;
	<span class="reserved">this</span>.htm = <span class="literal">""</span>;
	<span class="reserved">this</span>.wnd = wnd || window;

	<span class="reserved">if</span>(!jg_ok) _chkDHTM(<span class="reserved">this</span>.wnd);
	<span class="reserved">if</span>(jg_ok)
	{
		<span class="reserved">if</span>(cnv)
		{
			<span class="reserved">if</span>(typeof(cnv) == <span class="literal">"string"</span>)
				<span class="reserved">this</span>.cont = document.all? (<span class="reserved">this</span>.wnd.document.all[cnv] || null)
					: document.getElementById? (<span class="reserved">this</span>.wnd.document.getElementById(cnv) || null)
					: null;
			<span class="reserved">else</span> <span class="reserved">if</span>(cnv == window.document)
				<span class="reserved">this</span>.cont = document.getElementsByTagName(<span class="literal">"body"</span>)[0];
			<span class="comment">// If cnv is a direct reference to a canvas DOM node</span>
			<span class="comment">// (option suggested by Andreas Luleich)</span>
			<span class="reserved">else</span> <span class="reserved">this</span>.cont = cnv;
			<span class="comment">// Create new canvas inside container DIV. Thus the drawing and clearing</span>
			<span class="comment">// methods won't interfere with the container's inner html.</span>
			<span class="comment">// Solution suggested by Vladimir.</span>
			<span class="reserved">this</span>.cnv = <span class="reserved">this</span>.wnd.document.createElement(<span class="literal">"div"</span>);
			<span class="reserved">this</span>.cnv.style.fontSize=0;
			<span class="reserved">this</span>.cont.appendChild(<span class="reserved">this</span>.cnv);
			<span class="reserved">this</span>.paint = jg_dom? _pntCnvDom : _pntCnvIe;
		}
		<span class="reserved">else</span>
			<span class="reserved">this</span>.paint = _pntDoc;
	}
	<span class="reserved">else</span>
		<span class="reserved">this</span>.paint = _pntN;

	<span class="reserved">this</span>.setPrintable(false);
};

<span class="reserved">function</span> _mkLinVirt(aLin, x1, y1, x2, y2)
{
	var dx = Math.abs(x2-x1), dy = Math.abs(y2-y1),
	x = x1, y = y1,
	xIncr = (x1 &gt; x2)? -1 : 1,
	yIncr = (y1 &gt; y2)? -1 : 1,
	p,
	i = 0;
	<span class="reserved">if</span>(dx &gt;= dy)
	{
		var pr = dy&lt;&lt;1,
		pru = pr - (dx&lt;&lt;1);
		p = pr-dx;
		<span class="reserved">while</span>(dx &gt; 0)
		{--dx;
			<span class="reserved">if</span>(p &gt; 0)    <span class="comment">//  Increment y</span>
			{
				aLin[i++] = x;
				y += yIncr;
				p += pru;
			}
			<span class="reserved">else</span> p += pr;
			x += xIncr;
		}
	}
	<span class="reserved">else</span>
	{
		var pr = dx&lt;&lt;1,
		pru = pr - (dy&lt;&lt;1);
		p = pr-dy;
		<span class="reserved">while</span>(dy &gt; 0)
		{--dy;
			y += yIncr;
			aLin[i++] = x;
			<span class="reserved">if</span>(p &gt; 0)    <span class="comment">//  Increment x</span>
			{
				x += xIncr;
				p += pru;
			}
			<span class="reserved">else</span> p += pr;
		}
	}
	<span class="reserved">for</span>(var len = aLin.length, i = len-i; i;)
		aLin[len-(i--)] = x;
};

<span class="reserved">function</span> _CompInt(x, y)
{
	<span class="reserved">return</span>(x - y);
};

</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Nov 14 13:45:39 2011</div>
</body>
</html>
